package com.caigou.modules.vote.network.api

import com.caigou.comm.base.bean.CommentBean
import com.caigou.comm.base.bean.CommentItemBean
import com.caigou.comm.base.bean.HttpResult
import com.caigou.modules.vote.bean.GuessBean
import com.caigou.modules.vote.bean.RunDogBean
import com.caigou.modules.vote.bean.UnlikeBean
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * @author #Suyghur.
 * Created on 2021/09/26
 */
interface HttpVoteApiService {

    @GET("/api/prize/period/list")
    fun getPeriodList(@Query("year") year: Int, @Query("type") type: Int): Flow<HttpResult<MutableList<String>>>

    @GET("/api/menu/rundog/info")
    fun getRunDogDetail(@Query("year") year: Int, @Query("period") period: Int, @Query("userId") userId: String): Flow<HttpResult<RunDogBean>>

    @GET("/api/menu/guess/info")
    fun getGuessDetail(@Query("year") year: Int, @Query("period") period: Int, @Query("userId") userId: String): Flow<HttpResult<GuessBean>>

    @GET("/api/menu/unlike/info")
    fun getUnlikeDetail(@Query("year") year: Int, @Query("period") period: Int, @Query("userId") userId: String): Flow<HttpResult<UnlikeBean>>

    @GET("/api/menu/rundog/reply/list")
    fun getRunDogCommentList(
        @Query("page") page: Int,
        @Query("limit") limit: Int,
        @Query("dataId") dataId: Int,
        @Query("sort") sort: Int,
        @Query("currentUserId") currentUserId: String
    ): Flow<HttpResult<CommentBean>>

    @GET("/api/menu/guess/reply/list")
    fun getGuessCommentList(
        @Query("page") page: Int,
        @Query("limit") limit: Int,
        @Query("dataId") dataId: Int,
        @Query("sort") sort: Int,
        @Query("currentUserId") currentUserId: String
    ): Flow<HttpResult<CommentBean>>

    @GET("/api/menu/unlike/reply/list")
    fun getUnlikeCommentList(
        @Query("page") page: Int,
        @Query("limit") limit: Int,
        @Query("dataId") dataId: Int,
        @Query("sort") sort: Int,
        @Query("currentUserId") currentUserId: String
    ): Flow<HttpResult<CommentBean>>

    @GET("/api/menu/rundog/reply/details")
    fun getRunDogCommentDetail(@Query("dataId") dataId: Int, @Query("replyId") replyId: Int, @Query("userId") userId: String): Flow<HttpResult<CommentItemBean>>

    @GET("/api/menu/guess/reply/details")
    fun getGuessCommentDetail(@Query("dataId") dataId: Int, @Query("replyId") replyId: Int, @Query("userId") userId: String): Flow<HttpResult<CommentItemBean>>

    @GET("/api/menu/unlike/reply/details")
    fun getUnlikeCommentDetail(@Query("dataId") dataId: Int, @Query("replyId") replyId: Int, @Query("userId") userId: String): Flow<HttpResult<CommentItemBean>>

    @POST("/api/menu/rundog/reply")
    fun setRunDogReply(@Body body: RequestBody): Flow<HttpResult<String>>

    @POST("/api/menu/guess/reply")
    fun setGuessReply(@Body body: RequestBody): Flow<HttpResult<String>>

    @POST("/api/menu/unlike/reply")
    fun setUnlikeReply(@Body body: RequestBody): Flow<HttpResult<String>>

    @POST("/api/menu/rundog/like")
    fun setRunDogLike(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

    @POST("/api/menu/guess/like")
    fun setGuessLike(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

    @POST("/api/menu/unlike/like")
    fun setUnlikeLike(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

    @POST("/api/menu/rundog/reply/like")
    fun setRunDogCommentLike(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

    @POST("/api/menu/guess/reply/like")
    fun setGuessCommentLike(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

    @POST("/api/menu/unlike/reply/like")
    fun setUnlikeCommentLike(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>


}